<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<form class="layui-form" action="" id="from1">
    <div class="layui-form-item">
        <label class="layui-form-label">会员ID</label>
        <div class="layui-input-block">
            <input type="text" name="mid" id="mid" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会员名</label>
        <div class="layui-input-block">
            <input type="text" name="mname" id="mname" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会员电话</label>
        <div class="layui-input-block">
            <input type="text" name="mphone" id="mphone" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="memail" id="memail" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="text" name="mpassword" id="mpassword" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">注册时间</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test1" placeholder="yyyy-MM-dd">
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="text" name="mstatus" id="mstatus" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-input-block">
        <button class="layui-btn layui-btn-normal" type="button" style="width: 100px;" id="edit">保存</button>
        <!--<button class="layui-btn layui-btn-primary" type="button" style="width: 100px;"id="cancel">取消</button>-->
    </div>
</form>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-1.8.3.min.js"></script>
<script>
layui.use(['form', 'laydate','element'], function() {
    var form = layui.form;
    laydate = layui.laydate;
    $("#edit").click(function () {
        updateBankCard();
    })
    laydate.render({
        elem: '#test1'
    });
    //提交数据到后台
    function updateBankCard() {
        var mid=$("#mid").val();
        var mname=$("#mname").val();
        var mphone=$("#mphone").val();
        var memail=$("#memail").val();
        var mpassword=$("#mpassword").val();
        var createtime=$("#createtime").val();
        var mstatus=$("#mstatus").val();
        $.post("/insertMember",$("#from1").serialize(),
            function (respones) {
                if (respones==1){
                    layui.layer.msg("添加成功"+respones);
                }
                else{
                    layui.layer.msg("添加失败"+respones);
                }
            })
    }
});
</script>
</body>
</html>
